package com.yugao.fintech.antelope.base.config.core;

import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONWriter;
import com.yugao.fintech.antelope.base.config.model.ActionTypeEnum;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 消息推送队列
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class ConfigMsg {
    /**
     * 租户id
     */
    private Long tenantId;

    /**
     * 配置键值
     */
    private String configKey;

    /**
     * 配置值
     */
    private String configValue;

    /**
     * 动作类型
     */
    private ActionTypeEnum actionType;

    public String toMessage() {
        return JSON.toJSONString(this, JSONWriter.Feature.WriteEnumsUsingName);
    }
}
